package net.wimpi.modbus.msg;


public abstract class ModbusUtil extends ModbusMessageImpl {
	
	public static void setFunctionCode(ModbusMessageImpl m, int f_code){
		m.setFunctionCode(f_code);
	}

	public static void setMessageData(ModbusResponse res, ModbusRequest req) {
		if (!req.isHeadless()) {
			res.setTransactionID(req.getTransactionID());
		      res.setProtocolID(req.getProtocolID());
		} 
		else {
		    	res.setHeadless();
		}
		res.setUnitID(req.getUnitID());
		res.setFunctionCode(req.getFunctionCode());
	}
}
